package org.lem

import org.lem.auth.ShiroUser

class Volunteer extends Person {

  ShiroUser login
  Long volunteerId
  Date applicationDate
  String affiliations
  Date orientationDate
  Date trainingDate
  Location teachingLocation
  ClassTime teachingTime
  ClassDay teachingDay
  String teachingPosition
  String teachingLevel
  String nonCatholicAffiliation
  String status
  String comments
  VolunteerPosition preferredPosition
  Occupation occupation
  Boolean employerMatchingGifts
  String secondaryEmailAddress
  String workPhone
  String workExt
  String inputBy
  Date inputDate 

  List locationPreferences
  static hasMany = [skills: VolunteerSkill, locationPreferences: Location];

  static constraints = {
      login(nullable:true, blank:true)
    volunteerId()
    applicationDate(nullable:true)
    firstName()
    middleName(nullable:true)
    lastName()
    homeAddress(nullable:true)
    city(nullable:true)
    state(nullable:true)
    zip(nullable:true)
    homePhone(nullable:true)
    cellPhone(nullable:true)
    workPhone(nullable:true)
    workExt(nullable:true)
    emailAddress(email:true)
    secondaryEmailAddress(email:true, nullable:true)
    gender(inList:["Male", "Female"], nullable:true)
    dateOfBirth(nullable:true)
    countryOfBirth(nullable:true)
    nativeLanguage(nullable:true)
    otherLanguages(nullable:true)
    ethnicity(nullable:true)
    occupation(nullable:true)
    employerMatchingGifts(nullable:true)    


    teachingLocation(nullable:true)
    teachingTime(nullable:true)
    teachingDay(nullable:true)
    teachingPosition(nullable:true)
    teachingLevel(nullable:true)
    affiliations(nullable:true)
    nonCatholicAffiliation(nullable:true)
    status(inList:["Active", "Inactive"], nullable:true)
    comments(nullable:true)
    preferredPosition(nullable:true)

    orientationDate(nullable:true)
    trainingDate(nullable:true)
    inputBy(nullable:true)
    inputDate(nullable:true)
  }

  String toString() {
    "${volunteerId} - ${firstName} ${lastName}"
  }
}
